From 2b5302587645dcab7c012c550989b7a8e9bee72b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Oct 2024 23:04:27 +0000 Subject: Update blog post metadata and styles --- src/pages/blog/[...slug].astro | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/pages/blog/[...slug].astro') diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index bcd5eed..63d2c98 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -2,11 +2,14 @@ import { type CollectionEntry, getCollection } from "astro:content"; import Comments from "../../components/Comments.astro"; import Layout from "../../layouts/BaseLayout.astro"; +import dayjs from "dayjs"; type Props = CollectionEntry<"blog">; export async function getStaticPaths() { - const posts = await getCollection("blog"); + const posts = await getCollection("blog", ({ data }) => { + return data.draft !== true; + }); return posts.map((post) => ({ params: { slug: post.slug }, @@ -15,33 +18,30 @@ export async function getStaticPaths() { } const post = Astro.props; -const { Content, remarkPluginFrontmatter } = await post.render(); +const { Content } = await post.render(); +const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"); --- - -
-
+

{post.data.title}

+
+ +
+ +
+ +

Posted - -  by {post.data.author} ‐ - {remarkPluginFrontmatter.minutesRead} + + by {post.data.author}

-
- -
-
-- cgit v1.2.3